package com.example.practice.creative;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

public class SPUtil {
	private static SharedPreferences sp;
	private static SharedPreferences.Editor spe;
	
	
	public static  void init(Context context) {
		sp = context.getSharedPreferences("sp", Activity.MODE_PRIVATE);
		spe = sp.edit();
	}
	
	public static void setFloat(String key,float value) {
		spe.putFloat(key, value);
		spe.commit();
	}
	
	public static float getFloat(String key) {
		return sp.getFloat(key, 0);
	}
}
